<template>
    <div>
        <h5 class="picDetail_title">{{picDetail[0].name}}</h5>
        <ul class="mui-table-view picDetail_ul">
                <li class="mui-table-view-cell">营业时间:
                    <span class="">{{picDetail[0].businessHours}}</span>
                </li>
                <li class="mui-table-view-cell">电话:
                    <span class="">{{picDetail[0].phone}}</span>
                </li>
                <li class="mui-table-view-cell">地址:
                    <span class="">{{picDetail[0].address}}</span>
                </li>
        </ul>
         <div>

               <vue-preview :slides="slide1" @close="handleClose"></vue-preview>
         </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            id:this.$route.params.id,
            picDetail:[{
                name:''
            }],
             slide1:[
                    //   {
                    //         // src:'',
                    //         // msrc:'',
                    //         // // alt: '',
                    //         // // title: '',
                    //         // w: 200,
                    //         // h: 150
                    //     },
                       
             ]
             
        }
    },
    created() {
        this.getpicDetail();
    },
    methods: {
           handleClose () {
        console.log('close event')
      },
        getpicDetail(){
            this.$http({
                method:'get',
                url:'https://locally.uieee.com/categories/1/shops?id='+this.id

            }).then(res=>{
                console.log(res);
                this.picDetail=res.data;
                let arr={};//定义个空对象
                let imagesArr=res.data[0].images;//拿到回调的 images 数组
                let len=imagesArr.length;
                console.log(len);
                for(let i=0;i<len;i++){
                    console.log(arr);
                    arr.src=imagesArr[i];//把arr数组的第i个赋值给 arr.src
                    arr.msrc=imagesArr[i];
                    arr.w=200;
                    arr.h=150;
                    console.log(arr);
                    // console.log("第"+i+"个的arr是 "+arr.src);
                    this.slide1.push(arr);
                    // console.log("push完的数组:"+this.slide1)
                }
               
                
                // let arr=res.data[0].images;
                // console.log(arr);
                
                    })

        }
        
    },
}
</script>
